﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GameDevelopHelper.Wizard
{
    public partial class ProjectApprovalWizard : Form
    {
        //向导页面数量
        private int m_WizardCurCount = 0;
        private int m_WizardPageCount = 0;

        public ProjectApprovalWizard()
        {
            InitializeComponent();
        }


        private void CharacterEditorWizard_Load(object sender, EventArgs e)
        {
            m_WizardCurCount = 0;
            m_WizardPageCount = wzdApprovalControl.Pages.Count;
            UpdatePageTittle();
        }

        private void wzdApprovalControl_NextClick(object sender, DevExpress.XtraWizard.WizardCommandButtonClickEventArgs e)
        {
            UpdatePageTittle();
        }

        /// <summary>
        /// 更新向导标题文本计数
        /// </summary>
        /// <param name="bNext"></param>
        private void UpdatePageTittle(bool bNext = true)
        {

            if (bNext == true)
            {
                //当前页面递增1
                m_WizardCurCount++;
            }
            else
            {
                //当前页面递减1
                m_WizardCurCount--;
            }

            wzdApprovalControl.Text = 
                "游戏立项向导程序(" + m_WizardCurCount.ToString() + "/" + m_WizardPageCount.ToString() + ")";
        }

        /// <summary>
        /// 初始化控件
        /// </summary>
        private void InitControls()
        { 
            
        }

        /// <summary>
        /// 更新控件外观
        /// </summary>
        private void ResizeControl()
        {
            lsvSpecialSystem.Columns[0].Width = Convert.ToInt32(lsvSpecialSystem.Width * 0.25);
            lsvSpecialSystem.Columns[1].Width = Convert.ToInt32(lsvSpecialSystem.Width * 0.71);
        }

        private void wzdApprovalControl_PrevClick(object sender, DevExpress.XtraWizard.WizardCommandButtonClickEventArgs e)
        {
            UpdatePageTittle(false);
        }

        private void ProjectApprovalWizard_Resize(object sender, EventArgs e)
        {
            ResizeControl();
        }
    }
}
